<template>
	<view  class="swiper-container">
		<swiper style="height: 100%;"  :current="currentIndex" @change="handleChange" >
			<!-- 一个item对应这一个swiper的项 -->
			<swiper-item class="swiper-item" >
				<!-- <articleCard :cardData="item" ></articleCard> -->
				<articleCard v-for="(item) in 6" :key="item.id"  :cardData="cardData"></articleCard>
				<!-- <articleCard  ></articleCard> -->
			</swiper-item>
		</swiper>
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import {getArticle} from "../../Ajax/api/interface/home.js"
	const cardData = ref(null);
	const props = defineProps({
		lableList:Array,
		currentIndex:Number
	})
	const emit = defineEmits()
	function handleChange (e){
		emit("changeActiveIndex",e.detail.current)
	}
	const init = async ()=>{
	const res = await getArticle();
	cardData.value = res
		
	}
	init()
</script>

<style lang="scss" scoped>
@import "./scss/articleList.scss";
.swiper-item{
	display: flex;
	flex-direction: column;
	gap: 15rpx 0;
	padding: 2rpx;
}
</style>